package org.shell.commands;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;

public class ShellCommand extends Command {

    private Class classInstance;
    private Method methodInstance;
    private String description;

    public ShellCommand(String commandName, Class classInstance, Method methodInstance, String description) {
        this.commandName = commandName;
        this.classInstance = classInstance;
        this.methodInstance = methodInstance;
        this.description = description;
    }

    public String getClassName() {
        return classInstance.getCanonicalName();
    }

    public Boolean isStaticMethod() {
        return Modifier.isStatic(methodInstance.getModifiers());
    }

    public String getMethodName() {
        return methodInstance.getName();
    }

    public Class getClassInstance() {
        return classInstance;
    }

    public Method getMethodInstance() {
        return methodInstance;
    }

    public Class[] getParameterTypes() {
        return methodInstance.getParameterTypes();
    }

    public String getDescription() {
        return description;
    }
}
